package com.gitee.linmt.service.impl;

import com.gitee.linmt.entity.UserRole;
import com.gitee.linmt.repository.UserRoleRepository;
import com.gitee.linmt.service.UserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author linmt
 */
@Service
public class UserRoleServiceImpl implements UserRoleService {

    private final UserRoleRepository userRoleRepository;

    public UserRoleServiceImpl(UserRoleRepository userRoleRepository) {
        this.userRoleRepository = userRoleRepository;
    }

    @Override
    public List<UserRole> listByUserId(Integer userId) {
        return userRoleRepository.findByUserId(userId);
    }
}
